/**
 * 
 */
package com.yullage.ann.core;

import java.util.List;

/**
 * @author Yu-chun Huang
 * 
 */
public final class BiasNeuron extends Neuron {

	protected static final double BIAS_VALUE = -1;

	// Singleton
	private static BiasNeuron uniqInstance;

	private BiasNeuron() {
		super();
		type = NeuronType.BIAS;
	}

	public static synchronized BiasNeuron getInstance() {
		if (uniqInstance == null) {
			uniqInstance = new BiasNeuron();
		}
		return uniqInstance;
	}

	@Override
	public double getOutput() {
		return BIAS_VALUE;
	}

	@Override
	public void calculateOutput() {
		// Dummy method. Bias neuron doesn't need to do this.
	}

	@Override
	public void setOutput(double o) {
		// Dummy method. Bias neuron doesn't need to do this.
	}

	@Override
	public void addInNeuron(List<Neuron> neurons) {
		// Dummy method. Bias neuron doesn't need to do this.
	}

	@Override
	public void addInNeuron(Neuron neuron) {
		// Dummy method. Bias neuron doesn't need to do this.
	}

}
